import axios from 'axios';

const axiosInstance = axios.create({
  baseURL: 'http://10.21.4.212:9000/v1/sse',
});
axiosInstance.interceptors.response.use(
  function(response) {
    const { data } = response;
    if (data.code === '200' || data.code === 200) {
      return data.data;
    }
    return Promise.reject(data);
  },
  function(error) {
    return Promise.reject(error);  
  }
);

export default axiosInstance;